package main

import (
	"crypto/md5"
	"encoding/hex"
	"io"
	"log"
	"os"
)

func main2() {
	println(fileToMd5("\\\\Tj-yf-262jfp\\归档\\E7110P01\\rebirth1.0\\omc-ipmi-exporter.zip"))
}

func fileToMd5(filePath string) string {
	println(filePath)
	file, err := os.Open(filePath)
	if err != nil {
		log.Fatal(err)
	}
	defer func(file *os.File) {
		_ = file.Close()
	}(file)

	hash := md5.New()
	if _, err := io.Copy(hash, file); err != nil {
		log.Fatal(err)
	}
	return hex.EncodeToString(hash.Sum(nil))
}
